package com.company.service.impl.drinks;

import com.company.service.Drinks;

public class Coffee extends Drinks {
    String type;
    public void buy(){
        System.out.println("购买了一杯"+type+"咖啡。");
    }
    public Coffee(int type){
        switch (type){
            case 1:
                this.type = "加糖";
                break;
            case 2:
                this.type = "加奶";
                break;
            default:
                this.type = "原味";
                break;
        }
    }
}
